function getCookie(name) {
    var r = document.cookie.match("\\b" + name + "=([^;]*)\\b");
    return r ? r[1] : undefined;
}
$(function () {
    $(".loginbotton").click(function () {
        var name = $("input[name='name']").val();
        var password = $("input[name='password']").val();
        var params = {
            "name": name,
            "password": password,
        };

        $.ajax({
            url:hostpath + "/api/admin/login/",
            type: "post",
            contentType: "application/json",
            jsonpCallback:"result",
            data: JSON.stringify(params),
            success: function (resp) {
                alert(resp.errno)
            }
        })
    })
})